package com.sfac.springBoot.module.common.vo;

/**
 * personal demo
 **/
public class Result<T> {
    private int status;   //200 success 500 fail
    private String message;
    private T data;

    public Result() {
    }

    public Result(int status, String message, T data) {
        this.status = status;
        this.message = message;
        this.data = data;
    }

    public Result(int status, String message) {
        this.status = status;
        this.message = message;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public enum ResultStatus{
        //define enumeration
        SUCCESS(200),
        FAILED(500);

        //define attribute
        public int code;

        //define constructor
        ResultStatus(int code){
            this.code=code;
        }
    }
}
